import { getTradeDataMonthSummaryList, showMsg } from '../../../vuex/action'
import QueryModal from '../common/query-modal/query-modal.vue'

export default {
  data() {
    return {
      showQueryModal: false,
      params: {
        start: 0,
        limit: 9999,
        startTime: '',
        endTime: '',
        relaAccountType: ''
      },
      list: []
    }
  },
  events: {
    toogle_query() {
      this.queryMouthSummaryList()
    }
  },
  methods: {
    queryMouthSummaryList() {
      this.xGetTradeDataMonthSummaryList(this.params).then((res) => {
        this.showQueryModal = false
        this.list = res.data.list
      }).catch((res) => {
        this.xShowMsg({
					type: 'danger',
					content: res.error_msg
				})
      })
    }
  },
  vuex: {
    actions: {
      xGetTradeDataMonthSummaryList: getTradeDataMonthSummaryList,
      xShowMsg: showMsg
    }
  },
  components: {
    'query-modal': QueryModal
  }
}
